package com.seguriapp.gwt.client.login;

import com.google.gwt.event.shared.GwtEvent;

public class ComplaintReceivedEvent extends GwtEvent<ComplaintReceivedEventHandler> {

  public static final Type<ComplaintReceivedEventHandler> TYPE = new Type<ComplaintReceivedEventHandler>();

  private final int complaintsCount;

  public ComplaintReceivedEvent(final int complaintsCount) {
    this.complaintsCount = complaintsCount;
  }

  @Override
  public GwtEvent.Type<ComplaintReceivedEventHandler> getAssociatedType() {
    return TYPE;
  }

  @Override
  protected void dispatch(ComplaintReceivedEventHandler handler) {
    handler.onNewComplaint(this);
  }

  public static Type<ComplaintReceivedEventHandler> getType() {
    return TYPE;
  }

  public int getComplaintsCount() {
    return complaintsCount;
  }

}
